home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Animation How-To
/
Animation How-to CD.iso
/
PLY
/
CHAPTER2
/
BOLITA
/
BOLITA1A.PI
< prev
next >
Wrap
Text File
|
1994-01-01
|
4KB
|
156 lines
// Bumping line o' balls
start_frame 0
end_frame 179
total_frames 180
outfile balls
include "\ply\colors.inc"
// Set up background color & lights
background Navyblue
light <10, 10, -20>
light <-10, 10, -20>
light <0, 20, 0>
// Set up the camera
viewpoint {
from <11, 15,-20>
at <0, 4, 0>
up <0, 1, 0>
angle 30
resolution 320,200
aspect 1.43
}
define pi 3.14159
define rad pi / 180
if (frame==start_frame) {
static define t 0
static define moving 1
}
define phz 30 * sin(t * rad)
define ang 270 + phz
// sorry for the clutter
// ball 1
if (phz > 0 && 1 > (5 - moving)) {
define x1 8 * cos(ang * rad) + 1 * 2 - 6
define y1 8 * sin(ang * rad) + 8
}
else {
define x1 1 * 2 - 6
define y1 0
}
if (phz < 0 && 1 < (moving + 1)) {
define x1 8 * cos(ang * rad) + 1 * 2 - 6
define y1 8 * sin(ang * rad) + 8
}
// ball 2
if (phz > 0 && 2 > (5 - moving)) {
define x2 8 * cos(ang * rad) + 2 * 2 - 6
define y2 8 * sin(ang * rad) + 8
}
else {
define x2 2 * 2 - 6
define y2 0
}
if (phz < 0 && 2 < (moving + 1)) {
define x2 8 * cos(ang * rad) + 2 * 2 - 6
define y2 8 * sin(ang * rad) + 8
}
// ball 3
if (phz > 0 && 3 > (5 - moving)) {
define x3 8 * cos(ang * rad) + 3 * 2 - 6
define y3 8 * sin(ang * rad) + 8
}
else {
define x3 3 * 2 - 6
define y3 0
}
if (phz < 0 && 3 < (moving + 1)) {
define x3 8 * cos(ang * rad) + 3 * 2 - 6
define y3 8 * sin(ang * rad) + 8
}
// ball 4
if (phz > 0 && 4 > (5 - moving)) {
define x4 8 * cos(ang * rad) + 4 * 2 - 6
define y4 8 * sin(ang * rad) + 8
}
else {
define x4 4 * 2 - 6
define y4 0
}
if (phz < 0 && 4 < (moving + 1)) {
define x4 8 * cos(ang * rad) + 4 * 2 - 6
define y4 8 * sin(ang * rad) + 8
}
// ball 5
if (phz > 0 && 5 > (5 - moving)) {
define x5 8 * cos(ang * rad) + 5 * 2 - 6
define y5 8 * sin(ang * rad) + 8
}
else {
define x5 5 * 2 - 6
define y5 0
}
if (phz < 0 && 5 < (moving + 1)) {
define x5 8 * cos(ang * rad) + 5 * 2 - 6
define y5 8 * sin(ang * rad) + 8
}
define z 0
object { sphere <x1,y1,z>,1 shiny_blue }
object { sphere <x2,y2,z>,1 shiny_blue }
object { sphere <x3,y3,z>,1 shiny_blue }
object { sphere <x4,y4,z>,1 shiny_blue }
object { sphere <x5,y5,z>,1 shiny_blue }
object { cylinder <x1,y1+1,z>,<1*2-6,8,-3>,0.05 shiny_orange }
object { cylinder <x2,y2+1,z>,<2*2-6,8,-3>,0.05 shiny_orange }
object { cylinder <x3,y3+1,z>,<3*2-6,8,-3>,0.05 shiny_orange }
object { cylinder <x4,y4+1,z>,<4*2-6,8,-3>,0.05 shiny_orange }
object { cylinder <x5,y5+1,z>,<5*2-6,8,-3>,0.05 shiny_orange }
object { cylinder <x1,y1+1,z>,<1*2-6,8,3>,0.05 shiny_orange }
object { cylinder <x2,y2+1,z>,<2*2-6,8,3>,0.05 shiny_orange }
object { cylinder <x3,y3+1,z>,<3*2-6,8,3>,0.05 shiny_orange }
object { cylinder <x4,y4+1,z>,<4*2-6,8,3>,0.05 shiny_orange }
object { cylinder <x5,y5+1,z>,<5*2-6,8,3>,0.05 shiny_orange }
define real_dark <0.1,0.1,0.1>
define onyx texture { metallic { color real_dark } }
object { box <-6,7.9,-2.5>,<6,8.5,-1.5> onyx }
object { box <-6,7.9, 2.5>,<6,8.5, 1.5> onyx }
// make a shiny tabletop
object {
polygon 4,<-10,-1.2,-4>,<10,-1.2,-4>,<10,-1.2,4>,<-10,-1.2,4>
reflective_cyan
}
static define t t+10
if (fmod(t,360)==0) static define moving moving+1